Skip to content

docs(data): describe the built-in value lock that actually exists - #360

Open
lovepixel-git wants to merge 1 commit into
CoreBunch:mainfrom
lovepixel-git:docs/data-workspace-builtin-lock
Open

docs(data): describe the built-in value lock that actually exists#360
lovepixel-git wants to merge 1 commit into
CoreBunch:mainfrom
lovepixel-git:docs/data-workspace-builtin-lock

Conversation

@lovepixel-git

Copy link
Copy Markdown
Contributor

What is stale

#303 removed isBuiltInValueLocked and lockedBuiltInCellKey. Both now have zero references anywhere in src/, server/ or docs/ apart from the three sites this PR fixes.

The problem is not only the dead names. docs/features/data-workspace.md currently states the opposite of what the code does:

Built-in field values (row cells) are additionally read-only on the structural system tables (pages/components/layouts)

They are editable on existing records, which is what systemTableGuard.ts's own header says:

Built-in field values remain editable on existing records through both the Data workspace and their purpose-built authoring surfaces.

What actually survives is narrower and create-time only: protectedBuiltInCreateCellKey rejects a create that supplies built-in cells for a structural system table, so those rows are born through their own authoring surfaces rather than the generic row endpoint. posts is exempt via kind === 'postType', and the server enforces it at server/handlers/cms/data/tables.ts:313. The docs paragraph now describes that.

Two comments, same dead reference

PageTreeCell.tsx and PageTreeCell.test.tsx both justified the always-enabled "Open editor" button by claiming isBuiltInValueLocked holds for every built-in field of pages / components / layouts.

The behavior is correct and unchanged. Only the reasoning was wrong, and it was wrong in a way that mattered: readOnly on that cell does not come from a built-in value lock at all. It is a grid-level prop, and a pageTree cell is never editable inline because the tree is authored in the visual editor rather than typed into a cell. Both comments now say that instead.

Scope

Docs plus two comments. No behavior change, so no new test. bun run lint is clean and the 11 tests across PageTreeCell.test.tsx and systemTableGuard.test.ts pass.

Happy to drop the comment edits and keep this to the doc line if you would rather review them separately.

CoreBunch#303 removed `isBuiltInValueLocked` and `lockedBuiltInCellKey`, but the
docs still describe them. Both symbols now have zero references anywhere
in the codebase.

The paragraph is not just naming dead functions, it states the opposite
of current behavior. It says built-in row values are read-only on the
structural system tables. They are editable on existing records, exactly
as the guard's own header says. What survives is a narrower create-time
rule: `protectedBuiltInCreateCellKey` rejects a create that supplies
built-in cells for a structural system table, so those rows are born
through their own authoring surfaces rather than the generic row
endpoint. `posts` is exempt, and the server enforces it in
`server/handlers/cms/data/tables.ts`.

PageTreeCell and its test carried the same dead reference in comments,
justifying the always-read-only button behavior by a predicate that no
longer exists. The behavior is right and unchanged; the reasoning is now
stated in terms of what a `pageTree` cell is (authored in the visual
editor, never typed into a cell) rather than a deleted lock.

Docs only, plus two comments. No behavior change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant